/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package wee;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.m2g.SVGImage;
import org.netbeans.microedition.lcdui.LoginScreen;
import org.netbeans.microedition.lcdui.SimpleTableModel;
import org.netbeans.microedition.lcdui.SplashScreen;
import org.netbeans.microedition.lcdui.TableItem;
import org.netbeans.microedition.lcdui.WaitScreen;
import org.netbeans.microedition.svg.SVGMenu;
import org.netbeans.microedition.svg.SVGWaitScreen;
import org.netbeans.microedition.util.SimpleCancellableTask;
import shiftsservice.Shift;
import shiftsservice.ShiftsService;
import shiftsservice.ShiftsService_Stub;

/**
 * @author Ahmed Osama
 */
public class WEE extends MIDlet implements CommandListener {

    private boolean midletPaused = false;

    //<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0|
    private SplashScreen WelcomeScreen;
    private Form Menu;
    private TextField Result;
    private TextField usernameField;
    private WaitScreen waitScreen;
    private Alert Failure;
    private Alert Success;
    private Command itemCommand;
    private Command noCommand;
    private Command backCommand;
    private Command okCommand1;
    private Command noCommand1;
    private Command yesCommand;
    private Command backCommand1;
    private Command LoginCommand;
    private Command itemCommand3;
    private Command itemCommand2;
    private Command helpCommand;
    private Command okCommand;
    private Command SubmitCommand;
    private SimpleCancellableTask Submit;
    private SimpleCancellableTask task;
    private SVGImage svgImage;
    //</editor-fold>//GEN-END:|fields|0|

    /**
     * The WEE constructor.
     */
    public WEE() {
    }

    //<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
    //</editor-fold>//GEN-END:|methods|0|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize
    /**
     * Initilizes the application.
     * It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method.
     */
    private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize
        // write pre-initialize user code here
//GEN-LINE:|0-initialize|1|0-postInitialize
        // write post-initialize user code here
    }//GEN-BEGIN:|0-initialize|2|
    //</editor-fold>//GEN-END:|0-initialize|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Started point.
     */
    public void startMIDlet() {//GEN-END:|3-startMIDlet|0|3-preAction
        // write pre-action user code here
        switchDisplayable(null, getWelcomeScreen());//GEN-LINE:|3-startMIDlet|1|3-postAction
        // write post-action user code here
    }//GEN-BEGIN:|3-startMIDlet|2|
    //</editor-fold>//GEN-END:|3-startMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Resumed point.
     */
    public void resumeMIDlet() {//GEN-END:|4-resumeMIDlet|0|4-preAction
        // write pre-action user code here
//GEN-LINE:|4-resumeMIDlet|1|4-postAction
        // write post-action user code here
    }//GEN-BEGIN:|4-resumeMIDlet|2|
    //</editor-fold>//GEN-END:|4-resumeMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch
    /**
     * Switches a current displayable in a display. The <code>display</code> instance is taken from <code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.
     * @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately
     * @param nextDisplayable the Displayable to be set
     */
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch
        // write pre-switch user code here
        Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }//GEN-END:|5-switchDisplayable|1|5-postSwitch
        // write post-switch user code here
    }//GEN-BEGIN:|5-switchDisplayable|2|
    //</editor-fold>//GEN-END:|5-switchDisplayable|2|









    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand ">//GEN-BEGIN:|17-getter|0|17-preInit
    /**
     * Returns an initiliazed instance of itemCommand component.
     * @return the initialized component instance
     */
    public Command getItemCommand() {
        if (itemCommand == null) {//GEN-END:|17-getter|0|17-preInit
            // write pre-init user code here
            itemCommand = new Command("Login", Command.ITEM, 0);//GEN-LINE:|17-getter|1|17-postInit
            // write post-init user code here
        }//GEN-BEGIN:|17-getter|2|
        return itemCommand;
    }
    //</editor-fold>//GEN-END:|17-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a particular displayable.
     * @param command the Command that was invoked
     * @param displayable the Displayable where the command was invoked
     */
    public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction
        // write pre-action user code here
        if (displayable == Menu) {//GEN-BEGIN:|7-commandAction|1|115-preAction
            if (command == SubmitCommand) {//GEN-END:|7-commandAction|1|115-preAction
                // write pre-action user code here
                switchDisplayable(null, getWaitScreen());//GEN-LINE:|7-commandAction|2|115-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|3|82-preAction
        } else if (displayable == WelcomeScreen) {
            if (command == SplashScreen.DISMISS_COMMAND) {//GEN-END:|7-commandAction|3|82-preAction
                // write pre-action user code here
                switchDisplayable(null, getMenu());//GEN-LINE:|7-commandAction|4|82-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|5|118-preAction
        } else if (displayable == waitScreen) {
            if (command == WaitScreen.FAILURE_COMMAND) {//GEN-END:|7-commandAction|5|118-preAction
                // write pre-action user code here
                switchDisplayable(getFailure(), getMenu());//GEN-LINE:|7-commandAction|6|118-postAction
                // write post-action user code here
            } else if (command == WaitScreen.SUCCESS_COMMAND) {//GEN-LINE:|7-commandAction|7|117-preAction
                // write pre-action user code here
                switchDisplayable(getSuccess(), getMenu());//GEN-LINE:|7-commandAction|8|117-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|9|7-postCommandAction
        }//GEN-END:|7-commandAction|9|7-postCommandAction
        // write post-action user code here
    }//GEN-BEGIN:|7-commandAction|10|117-postAction
    //</editor-fold>//GEN-END:|7-commandAction|10|117-postAction






















    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: noCommand ">//GEN-BEGIN:|39-getter|0|39-preInit
    /**
     * Returns an initiliazed instance of noCommand component.
     * @return the initialized component instance
     */
    public Command getNoCommand() {
        if (noCommand == null) {//GEN-END:|39-getter|0|39-preInit
            // write pre-init user code here
            noCommand = new Command("Ok", Command.OK, 0);//GEN-LINE:|39-getter|1|39-postInit
            // write post-init user code here
        }//GEN-BEGIN:|39-getter|2|
        return noCommand;
    }
    //</editor-fold>//GEN-END:|39-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand ">//GEN-BEGIN:|41-getter|0|41-preInit
    /**
     * Returns an initiliazed instance of backCommand component.
     * @return the initialized component instance
     */
    public Command getBackCommand() {
        if (backCommand == null) {//GEN-END:|41-getter|0|41-preInit
            // write pre-init user code here
            backCommand = new Command("Back", Command.BACK, 0);//GEN-LINE:|41-getter|1|41-postInit
            // write post-init user code here
        }//GEN-BEGIN:|41-getter|2|
        return backCommand;
    }
    //</editor-fold>//GEN-END:|41-getter|2|



    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand1 ">//GEN-BEGIN:|46-getter|0|46-preInit
    /**
     * Returns an initiliazed instance of okCommand1 component.
     * @return the initialized component instance
     */
    public Command getOkCommand1() {
        if (okCommand1 == null) {//GEN-END:|46-getter|0|46-preInit
            // write pre-init user code here
            okCommand1 = new Command("Ok", Command.OK, 0);//GEN-LINE:|46-getter|1|46-postInit
            // write post-init user code here
        }//GEN-BEGIN:|46-getter|2|
        return okCommand1;
    }
    //</editor-fold>//GEN-END:|46-getter|2|



    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: yesCommand ">//GEN-BEGIN:|52-getter|0|52-preInit
    /**
     * Returns an initiliazed instance of yesCommand component.
     * @return the initialized component instance
     */
    public Command getYesCommand() {
        if (yesCommand == null) {//GEN-END:|52-getter|0|52-preInit
            // write pre-init user code here
            yesCommand = new Command("Yes", Command.OK, 0);//GEN-LINE:|52-getter|1|52-postInit
            // write post-init user code here
        }//GEN-BEGIN:|52-getter|2|
        return yesCommand;
    }
    //</editor-fold>//GEN-END:|52-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: noCommand1 ">//GEN-BEGIN:|55-getter|0|55-preInit
    /**
     * Returns an initiliazed instance of noCommand1 component.
     * @return the initialized component instance
     */
    public Command getNoCommand1() {
        if (noCommand1 == null) {//GEN-END:|55-getter|0|55-preInit
            // write pre-init user code here
            noCommand1 = new Command("No", Command.BACK, 0);//GEN-LINE:|55-getter|1|55-postInit
            // write post-init user code here
        }//GEN-BEGIN:|55-getter|2|
        return noCommand1;
    }
    //</editor-fold>//GEN-END:|55-getter|2|



    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: backCommand1 ">//GEN-BEGIN:|58-getter|0|58-preInit
    /**
     * Returns an initiliazed instance of backCommand1 component.
     * @return the initialized component instance
     */
    public Command getBackCommand1() {
        if (backCommand1 == null) {//GEN-END:|58-getter|0|58-preInit
            // write pre-init user code here
            backCommand1 = new Command("Back", Command.BACK, 0);//GEN-LINE:|58-getter|1|58-postInit
            // write post-init user code here
        }//GEN-BEGIN:|58-getter|2|
        return backCommand1;
    }
    //</editor-fold>//GEN-END:|58-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: LoginCommand ">//GEN-BEGIN:|60-getter|0|60-preInit
    /**
     * Returns an initiliazed instance of LoginCommand component.
     * @return the initialized component instance
     */
    public Command getLoginCommand() {
        if (LoginCommand == null) {//GEN-END:|60-getter|0|60-preInit
            // write pre-init user code here
            LoginCommand = new Command("Item", Command.ITEM, 0);//GEN-LINE:|60-getter|1|60-postInit
            // write post-init user code here
        }//GEN-BEGIN:|60-getter|2|
        return LoginCommand;
    }
    //</editor-fold>//GEN-END:|60-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand2 ">//GEN-BEGIN:|66-getter|0|66-preInit
    /**
     * Returns an initiliazed instance of itemCommand2 component.
     * @return the initialized component instance
     */
    public Command getItemCommand2() {
        if (itemCommand2 == null) {//GEN-END:|66-getter|0|66-preInit
            // write pre-init user code here
            itemCommand2 = new Command("Messages", Command.ITEM, 0);//GEN-LINE:|66-getter|1|66-postInit
            // write post-init user code here
        }//GEN-BEGIN:|66-getter|2|
        return itemCommand2;
    }
    //</editor-fold>//GEN-END:|66-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: itemCommand3 ">//GEN-BEGIN:|68-getter|0|68-preInit
    /**
     * Returns an initiliazed instance of itemCommand3 component.
     * @return the initialized component instance
     */
    public Command getItemCommand3() {
        if (itemCommand3 == null) {//GEN-END:|68-getter|0|68-preInit
            // write pre-init user code here
            itemCommand3 = new Command("PagerCall", Command.ITEM, 0);//GEN-LINE:|68-getter|1|68-postInit
            // write post-init user code here
        }//GEN-BEGIN:|68-getter|2|
        return itemCommand3;
    }
    //</editor-fold>//GEN-END:|68-getter|2|









    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: WelcomeScreen ">//GEN-BEGIN:|81-getter|0|81-preInit
    /**
     * Returns an initiliazed instance of WelcomeScreen component.
     * @return the initialized component instance
     */
    public SplashScreen getWelcomeScreen() {
        if (WelcomeScreen == null) {//GEN-END:|81-getter|0|81-preInit
            // write pre-init user code here
            WelcomeScreen = new SplashScreen(getDisplay());//GEN-BEGIN:|81-getter|1|81-postInit
            WelcomeScreen.setTitle("splashScreen");
            WelcomeScreen.setCommandListener(this);//GEN-END:|81-getter|1|81-postInit
            // write post-init user code here
        }//GEN-BEGIN:|81-getter|2|
        return WelcomeScreen;
    }
    //</editor-fold>//GEN-END:|81-getter|2|







    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: helpCommand ">//GEN-BEGIN:|89-getter|0|89-preInit
    /**
     * Returns an initiliazed instance of helpCommand component.
     * @return the initialized component instance
     */
    public Command getHelpCommand() {
        if (helpCommand == null) {//GEN-END:|89-getter|0|89-preInit
            // write pre-init user code here
            helpCommand = new Command("Help", Command.HELP, 0);//GEN-LINE:|89-getter|1|89-postInit
            // write post-init user code here
        }//GEN-BEGIN:|89-getter|2|
        return helpCommand;
    }
    //</editor-fold>//GEN-END:|89-getter|2|







    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Submit ">//GEN-BEGIN:|100-getter|0|100-preInit
    /**
     * Returns an initiliazed instance of Submit component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getSubmit() {
        if (Submit == null) {//GEN-END:|100-getter|0|100-preInit
            // write pre-init user code here
            Submit = new SimpleCancellableTask();//GEN-BEGIN:|100-getter|1|100-execute
            Submit.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|100-getter|1|100-execute
                    // write task-execution user code here
                    ShiftsService sh = new ShiftsService_Stub();
                    Shift shift = sh.getMyNightShift(usernameField.getString());
                    Result.setString(shift.getMyShiftType());
                    
                }//GEN-BEGIN:|100-getter|2|100-postInit
            });//GEN-END:|100-getter|2|100-postInit
            // write post-init user code here
        }//GEN-BEGIN:|100-getter|3|
        return Submit;
    }
    //</editor-fold>//GEN-END:|100-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Menu ">//GEN-BEGIN:|106-getter|0|106-preInit
    /**
     * Returns an initiliazed instance of Menu component.
     * @return the initialized component instance
     */
    public Form getMenu() {
        if (Menu == null) {//GEN-END:|106-getter|0|106-preInit
            // write pre-init user code here
            Menu = new Form("Menu", new Item[] { getUsernameField(), getResult() });//GEN-BEGIN:|106-getter|1|106-postInit
            Menu.addCommand(getSubmitCommand());
            Menu.setCommandListener(this);//GEN-END:|106-getter|1|106-postInit
            // write post-init user code here
        }//GEN-BEGIN:|106-getter|2|
        return Menu;
    }
    //</editor-fold>//GEN-END:|106-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: usernameField ">//GEN-BEGIN:|109-getter|0|109-preInit
    /**
     * Returns an initiliazed instance of usernameField component.
     * @return the initialized component instance
     */
    public TextField getUsernameField() {
        if (usernameField == null) {//GEN-END:|109-getter|0|109-preInit
            // write pre-init user code here
            usernameField = new TextField("UserName", null, 32, TextField.ANY);//GEN-LINE:|109-getter|1|109-postInit
            // write post-init user code here
        }//GEN-BEGIN:|109-getter|2|
        return usernameField;
    }
    //</editor-fold>//GEN-END:|109-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Result ">//GEN-BEGIN:|110-getter|0|110-preInit
    /**
     * Returns an initiliazed instance of Result component.
     * @return the initialized component instance
     */
    public TextField getResult() {
        if (Result == null) {//GEN-END:|110-getter|0|110-preInit
            // write pre-init user code here
            Result = new TextField("Result", null, 32, TextField.ANY);//GEN-LINE:|110-getter|1|110-postInit
            // write post-init user code here
        }//GEN-BEGIN:|110-getter|2|
        return Result;
    }
    //</editor-fold>//GEN-END:|110-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: okCommand ">//GEN-BEGIN:|107-getter|0|107-preInit
    /**
     * Returns an initiliazed instance of okCommand component.
     * @return the initialized component instance
     */
    public Command getOkCommand() {
        if (okCommand == null) {//GEN-END:|107-getter|0|107-preInit
            // write pre-init user code here
            okCommand = new Command("Ok", Command.OK, 0);//GEN-LINE:|107-getter|1|107-postInit
            // write post-init user code here
        }//GEN-BEGIN:|107-getter|2|
        return okCommand;
    }
    //</editor-fold>//GEN-END:|107-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: waitScreen ">//GEN-BEGIN:|116-getter|0|116-preInit
    /**
     * Returns an initiliazed instance of waitScreen component.
     * @return the initialized component instance
     */
    public WaitScreen getWaitScreen() {
        if (waitScreen == null) {//GEN-END:|116-getter|0|116-preInit
            // write pre-init user code here
            waitScreen = new WaitScreen(getDisplay());//GEN-BEGIN:|116-getter|1|116-postInit
            waitScreen.setTitle("waitScreen");
            waitScreen.setCommandListener(this);
            waitScreen.setTask(getSubmit());//GEN-END:|116-getter|1|116-postInit
            // write post-init user code here
        }//GEN-BEGIN:|116-getter|2|
        return waitScreen;
    }
    //</editor-fold>//GEN-END:|116-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Success ">//GEN-BEGIN:|124-getter|0|124-preInit
    /**
     * Returns an initiliazed instance of Success component.
     * @return the initialized component instance
     */
    public Alert getSuccess() {
        if (Success == null) {//GEN-END:|124-getter|0|124-preInit
            // write pre-init user code here
            Success = new Alert("Success", "Success Data Reterival!", null, null);//GEN-BEGIN:|124-getter|1|124-postInit
            Success.setTimeout(Alert.FOREVER);//GEN-END:|124-getter|1|124-postInit
            // write post-init user code here
        }//GEN-BEGIN:|124-getter|2|
        return Success;
    }
    //</editor-fold>//GEN-END:|124-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Failure ">//GEN-BEGIN:|126-getter|0|126-preInit
    /**
     * Returns an initiliazed instance of Failure component.
     * @return the initialized component instance
     */
    public Alert getFailure() {
        if (Failure == null) {//GEN-END:|126-getter|0|126-preInit
            // write pre-init user code here
            Failure = new Alert("Failure", "Reterival Failure!", null, null);//GEN-BEGIN:|126-getter|1|126-postInit
            Failure.setTimeout(Alert.FOREVER);//GEN-END:|126-getter|1|126-postInit
            // write post-init user code here
        }//GEN-BEGIN:|126-getter|2|
        return Failure;
    }
    //</editor-fold>//GEN-END:|126-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: SubmitCommand ">//GEN-BEGIN:|114-getter|0|114-preInit
    /**
     * Returns an initiliazed instance of SubmitCommand component.
     * @return the initialized component instance
     */
    public Command getSubmitCommand() {
        if (SubmitCommand == null) {//GEN-END:|114-getter|0|114-preInit
            // write pre-init user code here
            SubmitCommand = new Command("Item", Command.ITEM, 0);//GEN-LINE:|114-getter|1|114-postInit
            // write post-init user code here
        }//GEN-BEGIN:|114-getter|2|
        return SubmitCommand;
    }
    //</editor-fold>//GEN-END:|114-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task ">//GEN-BEGIN:|119-getter|0|119-preInit
    /**
     * Returns an initiliazed instance of task component.
     * @return the initialized component instance
     */
    public SimpleCancellableTask getTask() {
        if (task == null) {//GEN-END:|119-getter|0|119-preInit
            // write pre-init user code here
            task = new SimpleCancellableTask();//GEN-BEGIN:|119-getter|1|119-execute
            task.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|119-getter|1|119-execute
                    // write task-execution user code here
                }//GEN-BEGIN:|119-getter|2|119-postInit
            });//GEN-END:|119-getter|2|119-postInit
            // write post-init user code here
        }//GEN-BEGIN:|119-getter|3|
        return task;
    }
    //</editor-fold>//GEN-END:|119-getter|3|





    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: svgImage ">//GEN-BEGIN:|131-getter|0|131-preInit
    /**
     * Returns an initiliazed instance of svgImage component.
     * @return the initialized component instance
     */
    public SVGImage getSvgImage() {
        if (svgImage == null) {//GEN-END:|131-getter|0|131-preInit
            // write pre-init user code here
            svgImage = SVGImage.createEmptyImage(null);//GEN-LINE:|131-getter|1|131-postInit
            // write post-init user code here
        }//GEN-BEGIN:|131-getter|2|
        return svgImage;
    }
    //</editor-fold>//GEN-END:|131-getter|2|



    /**
     * Returns a display instance.
     * @return the display instance.
     */
    public Display getDisplay () {
        return Display.getDisplay(this);
    }

    /**
     * Exits MIDlet.
     */
    public void exitMIDlet() {
        switchDisplayable (null, null);
        destroyApp(true);
        notifyDestroyed();
    }

    /**
     * Called when MIDlet is started.
     * Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
     */
    public void startApp() {
        if (midletPaused) {
            resumeMIDlet ();
        } else {
            initialize ();
            startMIDlet ();
        }
        midletPaused = false;
    }

    /**
     * Called when MIDlet is paused.
     */
    public void pauseApp() {
        midletPaused = true;
    }

    /**
     * Called to signal the MIDlet to terminate.
     * @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.
     */
    public void destroyApp(boolean unconditional) {
    }

}
